 import {request} from '@/utils/request'
//base url
const BASE_URL = process.env.VUE_APP_API_BASE_URL
const api = {
    SystemToken: '/token/system',
    UserToken: '/token/user',
    Login: '/login/login',
    Logout: '/login/logout',
}

for (const apiKey in api) {
    api[apiKey] = BASE_URL + api[apiKey];
}

export function SystemToken (parameter) {
    return request( api.SystemToken,
        'get',
        null,
        { 'Timestamp': parameter }
    )
}

export function UserToken (parameter) {
    return request( api.UserToken,
        'post',
        parameter.data,
        parameter.hearders
    )
}

export function Login () {
    return request( api.Login,
         'get',
        null,
         // { 'Timestamp': parameter.timeStamp, 'Authorization': parameter.systemToken }
    )
}

export function Logout () {
    return request(
         api.Logout,
        'get',
        null
    )
}
export function vision () {
    return request( api.vision,
        'get',
        null,
        // {'Timestamp': parameter.timeStamp, 'Authorization': parameter.userToken }
    )
}
